package cc.xuzhi.muggle.devtools.controller;

import cc.xuzhi.muggle.common.model.Result;
import cc.xuzhi.muggle.devtools.model.dto.ConfigSaveDTO;
import cc.xuzhi.muggle.devtools.service.DevtoolsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 系统配置
 *
 * @author xuzhi
 * @date 2022-05-26 21:20:53
 */
@RestController
@RequestMapping("/devtools/config" )
public class DevtoolsConfigController {

    @Autowired
    private DevtoolsConfigService service;

    /**
     * 保存系统级别的日志
     * @param params
     * @return
     */
    @PostMapping("/system/save")
    public Result saveSystemConfig(@Valid @RequestBody ConfigSaveDTO params) {
        return Result.ok(service.saveSystemConfig(params));
    }

}
